#pragma once

// c std
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <time.h>

// c linux
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/select.h>
#include <sys/uio.h>

#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/udp.h>
#include <net/if.h>

#include <netdb.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>

typedef struct sockaddr SA;

struct unp_in_pktinfo {

    struct in_addr ipi_addr;    // destination IPV4 address
    int            ipi_ifindex; // received interface index
};

ssize_t recvfrom_flags(int fd,  void * ptr, size_t nbytes, int * flags, SA * sa, socklen_t * salenptr, struct unp_in_pktinfo * pktp);


